﻿using System.Collections.Generic;
using VOL.Entity.DomainModels;

namespace MyMES.Services.WarehouseManagement.Codings.DTOs
{
    /// <summary>
    /// 条码管理DTO
    /// </summary>
    public class BarcodeDTO
    {
        #region 查询条件
        /// <summary>
        /// 条码类型
        /// </summary>
        public string BarcodeType { get; set; }

        /// <summary>
        /// 业务编码
        /// </summary>
        public string BusinessCode { get; set; }

        /// <summary>
        /// 业务名称
        /// </summary>
        public string BusinessName { get; set; }
        #endregion

        #region 分页参数
        private int _pageIndex = 1;
        private int _pageSize = 10;

        /// <summary>
        /// 当前页码（从1开始）
        /// </summary>
        public int PageIndex
        {
            get => _pageIndex;
            set => _pageIndex = value < 1 ? 1 : value;
        }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize
        {
            get => _pageSize;
            set => _pageSize = value < 1 ? 10 : value;
        }

        /// <summary>
        /// 总记录数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages => (Total + PageSize - 1) / PageSize;

        /// <summary>
        /// 当前页数据
        /// </summary>
        public List<BarcodeManagement> Items { get; set; }
        #endregion
    }
}